package org.tokaf;

import java.util.Comparator;

/**
 * <p> MyTopKCompareNames compares two TopKElements by their names. </p> <p>
 * Copyright (c) 2006 </p> <p>
 * @author Alan Eckhardt
 * @version 1.0
 */
public class MyTopKCompareNames implements Comparator {
	public MyTopKCompareNames() {

	}

	public int compare(Object o1, Object o2) {
		if (o1 instanceof TopKElement && o2 instanceof TopKElement) {
			return ((TopKElement) o1).name.toString().compareTo(
					((TopKElement) o2).name.toString());
		}
		return 0;
	}

}
